﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SchemaExplorer;
using System.Configuration;

namespace ZX.WebApp.cspModel
{
  public static class DBSchema
    {
        private static string _commonConnectionString;

        public static string CommonConnectionString
        {
            get
            { 
                if (_commonConnectionString == null)
                {
                    _commonConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
                }
                return _commonConnectionString;
            }
        }

        public static DatabaseSchema CreateDatabaseSchema()
        {
            IDbSchemaProvider provider = new SqlSchemaProvider();
            return new DatabaseSchema(provider, CommonConnectionString);
        }
    }
}
